package pack0623;

public class Bird {
    int legs = 2;
    String type;
    String name;

    //飞翔方法
    public void fly(){
        System.out.println(name + type + "正在张开翅膀");
    }
    public Bird(String a){
        name = a;
    }
    public Bird(String n, String t){
        name = n;
        type = t;
    }
//    public void Bird(String n, String t) {
//        name = n;
//        type = t;
//    }

    public static void main(String[] args) {
//        Bird a = new Bird();
//        a.name = "小黑";
//        a.fly();
        System.out.println();
        Bird c = new Bird("a","k");
        c.fly();
        Bird b = new Bird("H", "DF");
        b.fly();
        System.out.println(b.legs);
    }
}
